package pl.prv.polanie.client.panels.lists;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.VerticalPanel;

public class ObjectsList extends VerticalPanel {

	Button addRecordButton = new Button("Add");
	Button removeSelectedRecordButton = new Button("Remove selected record");

	
	
	void setupButtons() {
		add(addRecordButton);
		add(removeSelectedRecordButton);
		removeSelectedRecordButton.setEnabled(false);
	}
	
	public void showRemoveSelectedRecordButton() {
		removeSelectedRecordButton.setEnabled(true);
	}
	
	public void hideRemoveSelectedRecordButton() {
		if (removeSelectedRecordButton.isAttached() &&
				removeSelectedRecordButton.getParent().equals(this)) {
			removeSelectedRecordButton.setEnabled(false);
		}
	}

	
}
